﻿<Window x:Class="AdTech.Snap.ConfigDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:media="clr-namespace:System.Windows.Media;assembly=PresentationCore"
        xmlns:cmn="http://adtech-dev.com/Common"
        Title="Configuration" Width="420" Height="244" MaxWidth="600"
        Background="Transparent" WindowStartupLocation="CenterScreen"
        MinWidth="{Binding Width, RelativeSource={RelativeSource Self}, Mode=OneTime}"
        MinHeight="{Binding Height, RelativeSource={RelativeSource Self}, Mode=OneTime}"
        MaxHeight="{Binding Height, RelativeSource={RelativeSource Self}, Mode=OneTime}">
    <Window.Resources>
        <ResourceDictionary Source="..\Styles.xaml" />
    </Window.Resources>
    <cmn:AttachedCommandBehaviour.Bindings>
        <cmn:AttachedCommandBinding Command="{Binding SaveCommand}" KeyGesture="CTRL+S" />
        <cmn:AttachedCommandBinding Command="{Binding SaveCommand}" KeyGesture="ENTER" />
        <cmn:AttachedCommandBinding Command="{Binding CloseCommand}" KeyGesture="ESC" />
        <cmn:AttachedCommandBinding Command="{Binding LoadedCommand}" Event="Loaded" />
        <cmn:AttachedCommandBinding Command="{Binding ClosingCommand}" Event="Closing" />
    </cmn:AttachedCommandBehaviour.Bindings>
    <DockPanel>
        <Border Name="border" DockPanel.Dock="Bottom" Style="{StaticResource glassAreaStyle}">
            <StackPanel Orientation="Horizontal">
                <Button Content="Save" Height="22" Command="{Binding SaveCommand}" Width="75" />
                <Button Content="Close" Height="22" Command="{Binding CloseCommand}" Width="75" Margin="1,0" />
            </StackPanel>
        </Border>
        <!--<Border CornerRadius="1" BorderBrush="#FFAEAEAF" BorderThickness="1">
            <Border CornerRadius="1" BorderBrush="#FF1E1E1E" BorderThickness="1">-->
                <Border Padding="5" Background="{StaticResource bgGradBlue}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="10"/>
                        </Grid.ColumnDefinitions>
                        <Label Content="Overlay Color" Grid.Row="0" Grid.Column="0" />
                        <Label Content="Opacity" Grid.Row="1" Grid.Column="0" />
                        <Label Content="Screenshot Path" Grid.Row="2" Grid.Column="0" />
                        <Label Content="Use Dropbox Integration" Margin="0,0,15,0" Grid.Row="3" Grid.Column="0" />
                        <Label Content="UserID" HorizontalAlignment="Right" Margin="10,0,0,0" Grid.Row="3" Grid.Column="2">
                            <cmn:AttachedCommandBehaviour.Bindings>
                                <cmn:AttachedCommandBinding Command="{Binding ExtractDropboxUIDCommand}" Event="PreviewMouseDoubleClick" />
                            </cmn:AttachedCommandBehaviour.Bindings>
                            <Label.Style>
                                <Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding UseDropbox}" Value="true">
                                            <Setter Property="Cursor" Value="Help" />
                                            <Setter Property="ToolTip" Value="Doubleclick here to find your UserID" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Label.Style>
                        </Label>
                        <Label Content="Create QRCode" Grid.Row="5" Grid.Column="0" />
                        <Label Content="Place Snap in AutoStart" Grid.Row="6" Grid.Column="0" />

                        <ComboBox IsEditable="False" IsReadOnly="True" ItemsSource="{Binding Brushes, Source={StaticResource BrushConverter}}"
                                  SelectedItem="{Binding OverlayColor, Mode=TwoWay, Converter={StaticResource BrushConverter}}"
                                  HorizontalAlignment="Left" Width="140" Margin="0,2,0,2" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Border Height="15" Width="15" Margin="3,3,0,3" BorderThickness="1" BorderBrush="Black" Background="{Binding Value, Mode=OneWay}"/>
                                        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="{Binding Key, Mode=OneWay}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                        <cmn:NumericUpDown Value="{Binding OverlayColorOpacity, UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="1" Step="0.1" DecimalPlaces="1" HorizontalAlignment="Left" Width="70" Margin="0,2,0,2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" />
                        <TextBox Text="{Binding DefaultFileDestination, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ErrorStyle}" Margin="0,2,0,2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" />
                        <Button Content=".." Command="{Binding SelectDestinationCommand}" Width="26" Height="22" Margin="5,1,0,1" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="4" />
                        <CheckBox IsChecked="{Binding UseDropbox}" VerticalAlignment="Center" Grid.Row="3" Grid.Column="1" />
                        <TextBox Text="{Binding DropboxUID, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding UseDropbox}" Margin="0,2" Width="60" HorizontalAlignment="Left" Grid.Row="3" Grid.Column="3" />
                        <CheckBox IsChecked="{Binding CreateQRCode}" VerticalAlignment="Center" Grid.Row="5" Grid.Column="1" />
                        <CheckBox IsChecked="{Binding IsInSystemStart}" VerticalAlignment="Center" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"/>
                    </Grid>
                </Border>
            <!--</Border>
        </Border>-->
    </DockPanel>
</Window>
